﻿
$(window).load(function () {
//    $("#J_NewAddressBtn").click(function () {
//        ShowAddress("");
//    });
//    updateorderaddr();
//    $("#J_Go").click(function () {
//        doSaveOrder();
//    });
});
$(function () {
    $("#J_BrandRecSlide .brand-rec-nav li").live("click", function () {
        var $self = $(this);
        $self.prevAll().removeClass("selected");
        $self.nextAll().removeClass("selected");
        $self.addClass("selected");
        var $contentt1 = $("#J_BrandRecSlide .brand-rec-content li:eq(" + $self.index() + ")");
        if ($contentt1.find(".brand-wall-content").hasClass("notloading")) {
            loadBrandlistdata($contentt1.find(".brand-wall-content").attr("hot-level"));
        }
        $contentt1.prevAll().hide();
        $contentt1.nextAll().hide();
        $contentt1.show();
    });
    $("#J_BrandRecSlide .j_BrandTriggerNext").live("click", function () {
        if ($(this).prev().hasClass("notloading")) {
            loadBrandlistdata($(this).prev().attr("hot-level"));
        } else {
            var $selp = $(this).prev().find(".brand-sel-pannel");
            if ($selp.next().length > 0) {
                $selp.next().addClass("brand-sel-pannel").removeClass("hidden").attr("z-index", "1").attr("opacity", "1").show();
                $selp.next().prevAll().removeClass("brand-sel-pannel").attr("z-index", "0").attr("opacity", "0").hide();
                $selp.next().nextAll().removeClass("brand-sel-pannel").attr("z-index", "0").attr("opacity", "0").hide();
            } else if ($selp.prev().length > 0) {
                $selp.parent().find(" p:eq(0)").addClass("brand-sel-pannel").removeClass("hidden").attr("z-index", "1").attr("opacity", "1").show();
                $selp.parent().find(" p:eq(0)").prevAll().removeClass("brand-sel-pannel").attr("z-index", "0").attr("opacity", "0").hide();
                $selp.parent().find(" p:eq(0)").nextAll().removeClass("brand-sel-pannel").attr("z-index", "0").attr("opacity", "0").hide();
            }
        }
    });
});
function loadBrandlistdata(sBLevel) { 
    var _jsParam = new jsonRow();
    _jsParam.AddCell("ACTION", "loadBrandlistdata");
    _jsParam.AddCell("HOT_LEVEL", sBLevel);
    ajaxComm(_jsParam);
};
function loadSetBrand(sBLevel, shtml) {
    $("#J_BrandRecSlide .brand-wall-content[hot-level='" + sBLevel + "']").html(shtml).removeClass('notloading');
};